package com.fangsheng.kafkastudy.test.controller;

import com.fangsheng.kafkastudy.test.KafkaProducer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @创建人: 放生
 * @创建时间: 2021/11/5
 * @描述:
 */
@Controller
@Slf4j
public class KafkaController {

    @Autowired
    private KafkaProducer kafkaProducer;
    int count = 0;

    @GetMapping("/send")
    @ResponseBody
    public void send(){
        kafkaProducer.send("this is test kafka message "+count++);

    }


}
